#ifndef __WATCHPOINT_H__
#define __WATCHPOINT_H__

#include "common.h"

typedef struct watchpoint {
	int NO;                  /* Watchpoint number */
	struct watchpoint *next; /* Pointer to next watchpoint in the list */
	
	char expr[128];         /* Expression string being monitored */
	int result;            /* Last evaluated value of the expression */
	bool enabled;          /* Whether this watchpoint is active */
} WP;

/* Watchpoint List Management */
WP* get_head(void);         /* Get the head of active watchpoint list */
WP* get_wp(int num);        /* Find watchpoint by its number */

/* Watchpoint Pool Operations */
WP* new_wp(void);           /* Allocate new watchpoint from free list */
void free_wp(WP *wp);       /* Return watchpoint to free list */
WP* delete_wp(int num, bool *success); /* Find and prepare watchpoint for deletion */

/* Watchpoint Monitoring */
bool checkWP(void);         /* Check all watchpoints for value changes */
void printf_wp(void);       /* Print information about all active watchpoints */

#endif
